home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / PInterfaces / ImageCodec.p < prev    next >
Encoding:
Text File  |  1993-09-17  |  7.0 KB  |  214 lines  |  [TEXT/MPS ]

  1. {************************************************************
  2.     Created: Wednesday, April 21, 1993
  3.     ImageCodec.p
  4.     Pascal Interface to the Macintosh Libraries
  5.     
  6.     Copyright Apple Computer, Inc. 1990-93
  7.     All rights reserved
  8. ************************************************************}
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.  UNIT ImageCodec;
  17.  INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingImageCodec}
  21. {$SETC UsingImageCodec := 1}
  22.  
  23. {$I+}
  24. {$SETC ImageCodecIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingQuickDraw}
  27. {$I $$Shell(PInterfaces)Quickdraw.p}
  28. {$ENDC}
  29. {$IFC UNDEFINED UsingQDOffscreen}
  30. {$I $$Shell(PInterfaces)QDOffscreen.p}
  31. {$ENDC}
  32.  
  33. {$IFC UNDEFINED UsingTypes}
  34. {$I $$Shell(PInterfaces)Types.p}
  35. {$ENDC}
  36.  
  37. {$IFC UNDEFINED UsingComponents}
  38. {$I $$Shell(PInterfaces)Components.p}
  39. {$ENDC}
  40.  
  41. {$IFC UNDEFINED UsingImageCompression}
  42. {$I $$Shell(PInterfaces)ImageCompression.p}
  43. {$ENDC}
  44.  
  45.  
  46. {$SETC UsingIncludes := ImageCodecIncludes}
  47.  
  48.  
  49. {    codec component selectors    }
  50. {    codec selectors 0-127 are reserved by Apple }
  51. {    codec selectors 128-191 are subtype specific }
  52. {    codec selectors 192-255 are vendor specific }
  53. {     codec selectors 256-32767 are reserved by Apple }
  54. {    negative selectors are reserved by the Component Manager }
  55.  
  56. CONST
  57. codecGetCodecInfo                    = $00;
  58. codecGetCompressionTime                = $01;
  59. codecGetMaxCompressionSize            = $02;
  60. codecPreCompress                    = $03;
  61. codecBandCompress                    = $04;
  62. codecPreDecompress                    = $05;
  63. codecBandDecompress                    = $06;
  64. codecCDSequenceBusy                    = $07;
  65. codecGetCompressedImageSize            = $08;
  66. codecGetSimilarity                    = $09;
  67. codecTrimImage                        = $0A;
  68. codecRequestSettings                = $0B;
  69. codecGetSettings                    = $0C;
  70. codecSetSettings                    = $0D;
  71.  
  72. {    codec capabilities flags    }
  73. codecCanScale                        = $1;
  74. codecCanMask                        = $2;
  75. codecCanMatte                        = $4;
  76. codecCanTransform                    = $8;
  77. codecCanTransferMode                = $10;
  78. codecCanCopyPrev                    = $20;
  79. codecCanSpool                        = $40;
  80. codecCanClipVertical                = $80;
  81. codecCanClipRectangular                = $100;
  82. codecCanRemapColor                    = $200;
  83. codecCanFastDither                    = $400;
  84. codecCanSrcExtract                    = $800;
  85. codecCanCopyPrevComp                = $1000;
  86. codecCanAsync                        = $2000;
  87. codecCanMakeMask                    = $4000;
  88. codecCanShift                        = $8000;
  89.  
  90. codecConditionFirstBand                = $1;    
  91. codecConditionLastBand                = $2;
  92. codecConditionFirstFrame            = $4;
  93. codecConditionNewDepth                = $8;
  94. codecConditionNewTransform            = $10;
  95. codecConditionNewSrcRect            = $20;
  96. codecConditionNewMask                = $40;
  97. codecConditionNewMatte                = $80;
  98. codecConditionNewTransferMode        = $100;
  99. codecConditionNewClut                = $200;
  100. codecConditionNewAccuracy            = $400;
  101. codecConditionNewDestination        = $800;
  102. codecConditionFirstScreen            = $1000;
  103. codecConditionCodecChangedMask        = $80000000;
  104.  
  105. codecInfoResourceType    =    'cdci';                    { codec info resource type }
  106. codecInterfaceVersion = 1;
  107.  
  108.  
  109. TYPE
  110. CodecCapabilitiesPtr =  ^CodecCapabilities;
  111. CodecCapabilities = RECORD
  112.                     flags            : LONGINT;
  113.                     wantedPixelSize    : INTEGER;
  114.                     extendWidth        : INTEGER;
  115.                     extendHeight    : INTEGER;
  116.                     bandMin            : INTEGER;
  117.                     bandInc            : INTEGER;
  118.                     pad                : INTEGER;
  119.                     time            : INTEGER;
  120.                     END;
  121.  
  122. CodecCompressParamsPtr = ^CodecCompressParams;
  123. CodecCompressParams =     RECORD
  124.                         sequenceID                 : ImageSequence;            { precompress,bandcompress }
  125.                         imageDescription        : ImageDescriptionHandle;    { precompress,bandcompress }
  126.                         data                     : Ptr;
  127.                         bufferSize                 : LONGINT;
  128.                         frameNumber                : LONGINT;
  129.                         startLine                : LONGINT;
  130.                         stopLine                : LONGINT;
  131.                         conditionFlags            : LONGINT;
  132.                         callerFlags             : CodecFlags;
  133.                         capabilities             : CodecCapabilitiesPtr;        { precompress,bandcompress }
  134.                         progressProcRecord         : ProgressProcRecord;
  135.                         completionProcRecord     : CompletionProcRecord;    
  136.                         flushProcRecord         : FlushProcRecord;
  137.                         srcPixMap                  : PixMap;                    { precompress,bandcompress }
  138.                         prevPixMap                 : PixMap;
  139.                         spatialQuality             : CodecQ;
  140.                         temporalQuality         : CodecQ;
  141.                         similarity                 : fixed;
  142.                         dataRateParams             : DataRateParamsPtr;
  143.                         reserved                : LONGINT;        
  144.                         END;
  145.  
  146. CodecDecompressParamsPtr = ^CodecDecompressParams;
  147. CodecDecompressParams = RECORD
  148.                         sequenceID                 : ImageSequence;            { predecompress,banddecompress }
  149.                         imageDescription         : ImageDescriptionHandle;    { predecompress,banddecompress }
  150.                         data                     : Ptr;
  151.                         bufferSize                 : LONGINT;
  152.                         frameNumber             : LONGINT;
  153.                         startLine                 : LONGINT;
  154.                         stopLine                 : LONGINT;
  155.                         conditionFlags             : LONGINT;
  156.                         callerFlags             : CodecFlags;
  157.                         capabilities             : CodecCapabilitiesPtr;        { predecompress,banddecompress }
  158.                         progressProcRecord         : ProgressProcRecord;
  159.                         completionProcRecord    : CompletionProcRecord;
  160.                         dataProcRecord             : DataProcRecord;
  161.                         port                     : CGrafPtr;                    { predecompress,banddecompress }
  162.                         dstPixMap                 : PixMap;                    { predecompress,banddecompress }
  163.                         maskBits                 : BitMapPtr;
  164.                         mattePixMap             : PixMapPtr;
  165.                         srcRect                 : Rect;                        { predecompress,banddecompress }
  166.                         matrix                     : MatrixRecordPtr;            { predecompress,banddecompress }
  167.                         accuracy                 : CodecQ;                    { predecompress,banddecompress }
  168.                         transferMode             : INTEGER;                    { predecompress,banddecompress }
  169.                         reserved                 : ARRAY [0..1] OF LONGINT;                
  170.                         END;
  171.  
  172.  
  173. FUNCTION CDGetCodecInfo(storage : Handle;VAR info: CodecInfo) : ComponentResult;
  174.  
  175. FUNCTION CDGetCompressionTime(storage : Handle; src: PixMapHandle; srcRect : Rect;  depth  :INTEGER ;
  176.      VAR spatialQuality: CodecQ; VAR temporalQuality: CodecQ;VAR time: LONGINT): ComponentResult;
  177.  
  178. FUNCTION CDGetMaxCompressionSize(storage : Handle; src : PixMapHandle; srcRect : Rect; 
  179.     depth : INTEGER; quality : CodecQ;VAR size : LONGINT) : ComponentResult;
  180.  
  181. FUNCTION CDPreCompress(storage : Handle;params : CodecCompressParamsPtr) : ComponentResult;
  182.  
  183. FUNCTION CDBandCompress(storage : Handle;params: CodecCompressParamsPtr) : ComponentResult;
  184.  
  185. FUNCTION CDPreDecompress(storage : Handle;params: CodecDecompressParamsPtr) : ComponentResult;
  186.  
  187. FUNCTION CDBandDecompress(storage : Handle;params: CodecDecompressParamsPtr) : ComponentResult;
  188.  
  189. FUNCTION CDCodecBusy(storage : Handle;seq : ImageSequence) : ComponentResult;
  190.  
  191. FUNCTION CDGetCompressedImageSize(storage : Handle; desc : ImageDescriptionHandle;data : PTR;
  192.     bufferSize :LONGINT;  dataProc : DataProcRecordPtr;VAR dataSize: LONGINT) : ComponentResult;
  193.  
  194. FUNCTION CDGetSimilarity(storage : Handle; src : PixMapHandle; srcRect : Rect;
  195.      desc : ImageDescriptionHandle; data : Ptr; VAR similarity : Fixed) : ComponentResult;
  196.  
  197. FUNCTION CDTrimImage(storage : Handle; desc : ImageDescriptionHandle; inData: Ptr; inBufferSize : LONGINT; 
  198.      dataProc : DataProcRecordPtr; outData : Ptr; outBufferSize : LONGINT; 
  199.      flushProc : FlushProcRecordPtr; VAR trimRect : Rect; progressProc : ProgressProcRecordPtr) : ComponentResult;
  200.  
  201. FUNCTION CDRequestSettings(storage : Handle; settings : Handle; VAR r : Rect ; filterProc : ModalFilterProcPtr) : ComponentResult;
  202.  
  203. FUNCTION CDGetSettings(storage : Handle; settings : Handle) : ComponentResult;
  204.  
  205. FUNCTION CDSetSettings(storage : Handle; settings : Handle) : ComponentResult;
  206.  
  207.  
  208. {$ENDC} { UsingImageCodec }
  209.  
  210. {$IFC NOT UsingIncludes}
  211.  END.
  212. {$ENDC}
  213.  
  214.